import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/position/positionAssessResult/subjective/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const subjectiveResultStart = (assessType, positionAssessResultId, assessUserId) => {
  return request({
    url: '/position/subjectiveResult/start',
    method: 'post',
    data:{
      assessType, positionAssessResultId, assessUserId
    }
  })
}
export const submit_subjectiveResultStart = (data) => {
  return request({
    url: '/position/subjectiveResult/submit',
    method: 'post',
    data
  })
}
export const save_subjectiveResultStart = (data) => {
  return request({
    url: '/position/subjectiveResult/submit',
    method: 'post',
    data
  })
}
/**
 * 评估项
 * @param {*} assessType 
 * @param {*} positionAssessResultId 
 * @param {*} assessUserId 
 * @returns 
 */
export const getAssessItem = (parId) => {
  return request({
    url: '/position/subjectiveResult/assessItem',
    method: 'get',
    params: {
      parId
    }
  })
}

/**
 * 代办-评估 当前账户
 * @returns 
 */
export const getListUser = () => {
  return request({
    url: '/position/subjectiveResult/list',
    method: 'get',
  })
}
/**
 * 评价任务详情
 * @returns 
 */
export const getDetail = (id) => {
  return request({
    url: '/position/subjectiveResult/detail',
    method: 'get',
    params: {
      id
    }
  })
}
/**
 * 确认考核结果
 * @returns 
 */
export const confirmAssessResult = (id,isPass,note) => {
  return request({
    url: '/position/positionAssessResult/confirm',
    method: 'post',
    params: {
      id,isPass,note
    }
  })
}
